<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/common.jspf" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>


</head>
<!-- 
标签：
声明控件：class="easyui-控件名"，例如：class="easyui-dialog"
控件属性：data-options="属性名:'属性值',属性名:'属性值'"，例如：data-options="iconCls:'icon-save',resizable:true
控件事件：data-options="属性名:'属性值',事件名:function(){}"，
Js:
声明控件：$(选择器).控件名({
  属性名：属性值，
   属性名：属性值，
  事件名：function(){},
   事件名：function(){}
});

如何调用控件已有的方法：
 $(选择器).控件名("方法名", "方法参数");
 $(选择器).控件名("方法名", {参数名：参数值，参数名：参数值 });
 -->
 <script type="text/javascript">
 
 function loadDG(){
	 var username =  $('#username').val();
	 var phone =$('#phone').val();
	 
	 alert(username+","+phone);
	 $('#dg').datagrid('load',{
			username: username,
			phone: phone 
		});
 }
 
 
   $(function (){
	   $('#dg').datagrid({    
		   // url:'${proPath}/datagrid_data1.json', // user/select.action
		    url:'${proPath}/user/selectPage.action',
		   // method:'post',
		   //idfield:'productid',
		    columns:[[    
				{checkbox:true},
		        {field:'id',title:'编号',width:100},    
		        {field:'username',title:'名称',width:100},    
		        {field:'usercode',title:'账号',width:100,align:'right'}    
		    ]],
		    fitColumns:true,
		    toolbar: [{
				iconCls: 'icon-save',
				text:'添加',
				handler: function(){
					alert('添加');
					
					 parent.$('#win').window({    
						    width:600,    
						    height:300, 
						    title:'添加用户',
						    modal:true,
							content:"<iframe src='${proPath}/adduser.html' title='添加用户' height='100%' width='100%' frameborder='0px'/>"

							/* content:"<iframe src='${proPath}/base/goURL?url=user/adduser' title='添加用户' height='100%' width='100%' frameborder='0px'/>"
				 */	 });
					
					
					}
			},'-',{
				iconCls: 'icon-edit',
				text:'修改',
				handler: function(){
					alert('修改按钮');
					}
			},'-',{
				iconCls: 'icon-remove',
				text:'删除',
				handler: function(){
					alert('删除按钮');
					}
			}],
			striped:true,
			rownumbers:true,
			pagination:true,
			pageSize:3,
			pageList:[3,5,7,20,25],
			/* queryParams: {
				userName: 'easyui',
				userAddress: 'datagrid'
			} */


		});  
	 
  }); 
 </script>
<body>
<div id="p" class="easyui-panel" title="查询用户"   >
<form action="">
姓名:<input type="text" id="username" name="username">
电话:<input type="text" id="phone" name="phone">
<input type="button" onclick="loadDG()" value="查询">
</form>
</div>
<table id="dg"></table> 


 
  
</body>
</html>